toggleEditTokenField = function(id){
	$('show_token_'+id).toggle()
	$('edit_token_'+id).toggle()
	$('save_token_'+id).toggle()
}

saveToken = function(id){
	$('edit_token_'+id).request({
		method: 'put',
		onSuccess: function() {
			document.location.reload();	
		},
		onFailure: function(response) {
			//$('errors').update(response.responseText);
		}
	});
}

deleteToken = function(url)
{
	var request_headers = ['Accept', 'application/xhtml+xml'];
	
	new Ajax.Request(url, {
		method: 'delete',
		requestHeaders: request_headers,
		onSuccess: function(transport) {
			document.location.reload();		
		}
	});
};